<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渐变</title>
    <style>
        .grad1{
            width: 200px;
            height: 200px;
	        background-color: red;
            background-image: linear-gradient(#ec6e3c, #608036);
            text-align: center;
            display: table-cell;
            vertical-align: middle;
        }
        .grad2{
            height: 200px;
            width: 200px;
            background-color: red;
            background-image: linear-gradient(to right, #ec6e3c, #608036);
            text-align: center;
            display: table-cell;
            vertical-align: middle;
        } 
        .grad3{
            height: 200px;
            width: 200px;
            background-color: red; 
            background-image: linear-gradient(to bottom right, #ec6e3c, #608036);
            text-align: center;
            display: table-cell;
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <div class="grad1">我是线性渐变--上下型</div><br>
    <div class="grad2">我是线性渐变--左右型</div><br>
    <div class="grad3">我是线性渐变--对角线型</div>
</body>
</html>